package com.rongc.client.freight.business.supply.model;

import android.content.Context;
import android.os.Bundle;

import com.rongc.client.core.utils.ActivityUtils;
import com.rongc.client.freight.business.supply.view.activity.SupplyWaybillActivity;
import com.rongc.client.freight.business.supply.view.activity.SupplyWaybillDetailActivity;

import static com.rongc.client.freight.business.supply.model.SupplyDic.StatusType.CANEL_STATUS;
import static com.rongc.client.freight.business.supply.model.SupplyDic.StatusType.COMPLATE_STATUS;
import static com.rongc.client.freight.business.supply.model.SupplyDic.StatusType.DTH_STATUS;
import static com.rongc.client.freight.business.supply.model.SupplyDic.StatusType.DZF_STATUS;
import static com.rongc.client.freight.business.supply.model.SupplyDic.StatusType.HD_TYPE;
import static com.rongc.client.freight.business.supply.model.SupplyDic.StatusType.JDZ_TYPE;
import static com.rongc.client.freight.business.supply.model.SupplyDic.StatusType.PD_STATUS;
import static com.rongc.client.freight.business.supply.model.SupplyDic.StatusType.ROAD_STATUS;
import static com.rongc.client.freight.business.supply.model.SupplyDic.StatusType.SH_STATUS;
import static com.rongc.client.freight.business.supply.model.SupplyDic.StatusType.TH_TYPE;

/**
 * Created by ccqx on 2017/6/28.
 */

public class SupplyDic {

    /**
     * 返回值类型
     */
    public final static class ResultType {
        /** 车型 */
        public static final int Model_TYPE = 10;
        /** 车长 */
        public static final int Length_TYPE = 11;
        /** 出发地 */
        public static final int DEPARTURE_TYPE = 12;
        /** 目的地 */
        public static final int DESTINATION_TYPE = 13;
        /** 留言 */
        public static final int MESSAGE_TYPE = 14;
    }

    /**
     * 运单状态
     */
    public final static class StatusType {

//        货主方：派单中  待支付   待提货   运单中    确认收货   完成      取消
//        司机方：接单中  待货主支付  确定提货   运单中  确认货到   完成   取消
        /** 派单中 */
        public static final int PD_STATUS = 1;
        /** 待支付 */
        public static final int DZF_STATUS = 2;
        /** 待提货 */
        public static final int DTH_STATUS = 3;
        /** 运单中 */
        public static final int ROAD_STATUS = 5;
        /** 确认收货 */
        public static final int SH_STATUS = 7;
        /** 完成 */
        public static final int COMPLATE_STATUS = 8;
        /** 取消 */
        public static final int CANEL_STATUS = 9;

        /** 接单中 */
        public static final int JDZ_TYPE = 10;
        /** 确定提货 */
        public static final int TH_TYPE = 4;
        /** 确认货到 */
        public static final int HD_TYPE = 6;
    }

    public static void jumpActivity(Context context,int position, SupplyBean data){
        switch (position){
            case PD_STATUS:
                Bundle bundle = new Bundle();
                bundle.putString("data",data.getId());
                ActivityUtils.startActivity(context,SupplyWaybillActivity.class,bundle);
                break;
            case JDZ_TYPE:
            case DZF_STATUS:
                bundle = new Bundle();
                bundle.putString("data",data.getId());
                ActivityUtils.startActivity(context,SupplyWaybillDetailActivity.class,bundle);
                break;
            case DTH_STATUS:
            case ROAD_STATUS:
            case SH_STATUS:
            case COMPLATE_STATUS:
            case CANEL_STATUS:
            case TH_TYPE:
            case HD_TYPE:
                ActivityUtils.toast("jump waybill");
                break;
        }
    }

    public static String getStatusStr(int status){
        String statusStr = "";
        switch (status){
            case PD_STATUS:
                statusStr = "派单中";
                break;
            case DZF_STATUS:
                statusStr = "待支付";
                break;
            case DTH_STATUS:
                statusStr = "待提货";
                break;
            case ROAD_STATUS:
                statusStr = "运单中";
                break;
            case SH_STATUS:
                statusStr = "确认收货";
                break;
            case COMPLATE_STATUS:
                statusStr = "完成";
                break;
            case CANEL_STATUS:
                statusStr = "取消";
                break;
            case JDZ_TYPE:
                statusStr = "接单中";
                break;
            case TH_TYPE:
                statusStr = "确定提货";
                break;
            case HD_TYPE:
                statusStr = "确认货到";
                break;

        }

        return statusStr;
    }

}
